package persis

import (
	"go.mongodb.org/mongo-driver/bson/primitive"
	"math/rand"
	"reflect"
)

type User struct {
	OId      primitive.ObjectID `bson:"_id" json:"-"`
	UserId   int64
	UserName string
}

func NewUser(userName string) *User {
	return &User{
		UserId:   rand.Int63(),
		UserName: userName,
	}
}

func (u User) GetObjId() primitive.ObjectID {
	return u.OId
}

var UserClassType = reflect.TypeOf(User{})
